package com.zhoug.demo.sendpush.huawei;

/**
 * @description: 类的简要描述
 * @author: 35574
 * @date: 2025/11/4 18:02
 */
public class HuaweiPushToken {
    private String clientId;
    private String clientSecret;

    /**
     * token
     */
    private String access_token;
    /**
     * token 类型
     * eg. Bearer
     */
    private String token_type;
    /**
     * 有效时间 单位秒
     * eg. 3600
     */
    private int expires_in;
    /**
     * 扩展字段:过期时间 根据请求时间和expires_in计算出的数据
     */
    private long exp_expiresTimeMillis;//

    public String getClientId() {
        return clientId;
    }

    public void setClientId(String clientId) {
        this.clientId = clientId;
    }

    public String getClientSecret() {
        return clientSecret;
    }

    public void setClientSecret(String clientSecret) {
        this.clientSecret = clientSecret;
    }

    public String getAccess_token() {
        return access_token;
    }

    public void setAccess_token(String access_token) {
        this.access_token = access_token;
    }

    public String getToken_type() {
        return token_type;
    }

    public void setToken_type(String token_type) {
        this.token_type = token_type;
    }

    public int getExpires_in() {
        return expires_in;
    }

    public void setExpires_in(int expires_in) {
        this.expires_in = expires_in;
    }

    public void setExp_expiresTimeMillis(long exp_expiresTimeMillis) {
        this.exp_expiresTimeMillis = exp_expiresTimeMillis;
    }

    public long getExp_expiresTimeMillis() {
        return exp_expiresTimeMillis;
    }

    /**
     * 是否过期
     * @return
     */
    public boolean isExpired() {
        return exp_expiresTimeMillis <= System.currentTimeMillis();
    }

}
